import $router from '@/router';
import OneUtil from '@/utils/OneUtil';
export default {
	goLogin: function() {
		this.goRouter('login');
	},
	goHome: function(param){
		if(OneUtil.ObjectIsNull(param)) {
			this.goRouter('home');
		} else {
			this.goRouter('home',param);
		}
	},
	goRouter:function(name,param) {
		if(OneUtil.ObjectNotNull(param)){
			let jsonParam = JSON.stringify(param)
			$router.push({'name':name, state:{jumpObject:jsonParam}});
		} else {
			$router.push({'name':name});
		}
	}
}